home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Bus / T-Z / VCR+(app+src) Folder / Sources / f1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-17  |  447 b   |  31 lines  |  [TEXT/KAHL]

  1. #include "VCRplus.h"
  2.  
  3. extern    long        CODE_VALUE;
  4.  
  5. /* first function */
  6. long     f1(long inval)
  7. {
  8.     long     ndigits, hashval ;
  9.     long     pwr ;
  10.  
  11.  
  12.     ndigits = 0;
  13.     pwr = 1;
  14.     while(inval >= pwr)
  15.     {
  16.         ndigits++;
  17.         pwr *= 10;
  18.     } ;
  19.     
  20.     if(ndigits > 8)
  21.         SetDText(19, "\pError: number will have more than 8 digits!");
  22.     
  23.     pwr = pwr / 10 ;
  24.  
  25.     hashval = inval;
  26. again:    hashval = mixup(hashval, CODE_VALUE) % (pwr * 10) ;
  27.     if(hashval < pwr) goto again ;
  28.  
  29.     return(hashval);
  30. }
  31.